<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>ICE HOCKEY MANAGER - Team Info</title>
            <link rel="stylesheet" href="graphics/style.css" media="screen" />
        </head>
        <body>

            <div id="head">
                <h1><h:outputText value="Ice Hockey Manager"/></h1>
            </div>

            <h:form>
                <div id="top-panel">
                    <h:outputText value="#{msgs.logged_in_as}: #{manager.loginName} " />
                    <h:outputText value="(#{msgs.chosen_club}: #{manager.currentClub.name}) " rendered="#{manager.hasClub}" />
                    <h:commandButton value="#{msgs.logout}" action="#{manager.logout}" />
                </div>

                <ul id="menu">
                    <li>
                        <h:commandLink action="#{manager.editTeam}" value="#{msgs.my_team}" />
                    </li>
                    <li>
                        <h:commandLink action="#{manager.browseOtherTeams}" value="#{msgs.other_teams}" />
                    </li>
                    <li>
                        <h:commandLink action="#{manager.editOffers}" value="#{msgs.offers}" />
                    </li>
                    <li>
                        <h:commandLink action="#{manager.editClub}" value="#{msgs.edit}" />
                    </li>
                    <li>
                        <h:commandLink action="#{manager.editPassword}" value="#{msgs.change_pass}" />
                    </li>
                    <li>
                        <h:commandLink action="#{manager.clubsList}" value="#{msgs.clubsList}" />
                    </li>
                    <li>
                        <h:commandLink action="#{manager.createClub}" value="#{msgs.createNewClub}" />
                    </li>
                    <li>
                        <h:commandLink action="#{manager.createLeague}" value="#{msgs.createNewLeague}" rendered="#{manager.isAdmin}" />
                    </li>
                </ul>

                    </h:form>

                <div id="content">
                    <div id="in">

                        <h:form>

                            <h2><h:outputText value="#{manager.club.name}"/></h2>

                            <h:outputText value="#{msgs.offerForPlayer} #{manager.wantedPlayer.firstName} #{manager.wantedPlayer.surname} #{msgs.amount} " rendered="#{manager.isInterestedInAnyPlayer}"/>
                            <h:inputText value="#{manager.offeredMoney}"  required="true" rendered="#{manager.isInterestedInAnyPlayer}" requiredMessage="#{msgs.offered_money_required}" style="text-align: right;" size="10">
                                <f:validator validatorId="PositiveIntValidator"/>
                            </h:inputText>
                            <h:outputText value="Kč " rendered="#{manager.isInterestedInAnyPlayer}"/>
                            <h:commandButton action="#{manager.makeOffer}" value="#{msgs.makeOffer}" rendered="#{manager.isInterestedInAnyPlayer}"/>
                            <h:messages rendered="#{manager.isInterestedInAnyPlayer}" />

                            </h:form>
                            <h:form>


                            <h3><h:outputText value="#{msgs.goaltenders}"/></h3>
                            <h:dataTable value="#{manager.goaltendersModel}" var="item" rowClasses="OddRow,EvenRow" columnClasses="post,playerName,skill,skill,skill,skill,skill,skill,skill,switchPost">
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.pos}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.positionInCurrentTeam}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.player_name}"/>
                                    </f:facet>
                                    <h:graphicImage value="graphics/cze.png" width="20" height="14" alt="CZE" rendered="#{item.nationality == 'CZE'}"/>
                                    <h:graphicImage value="graphics/svk.gif" width="20" height="13" alt="SVK" rendered="#{item.nationality == 'SVK'}"/>
                                    <h:outputText value=" #{item.firstName} #{item.surname}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.age}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.age}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.pst}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.post}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.goa}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.goalkeeping}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.tec}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.technique}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.str}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.strength}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.spe}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.speed}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.sho}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.shot}"/>
                                </h:column>
                                <h:column rendered="#{manager.hasClub}">
                                    <h:commandButton action="#{manager.buyGoaltender}" value="#{msgs.buy}" />
                                </h:column>
                            </h:dataTable>



                            <h3><h:outputText value="#{msgs.first_line}"/></h3>
                            <h:dataTable value="#{manager.firstLineModel}" var="item" rowClasses="OddRow,EvenRow" columnClasses="post,playerName,skill,skill,skill,skill,skill,skill,skill,switchPost">
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.pos}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.positionInCurrentTeam}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.player_name}"/>
                                    </f:facet>
                                    <h:graphicImage value="graphics/cze.png" width="20" height="14" alt="CZE" rendered="#{item.nationality == 'CZE'}"/>
                                    <h:graphicImage value="graphics/svk.gif" width="20" height="13" alt="SVK" rendered="#{item.nationality == 'SVK'}"/>
                                    <h:outputText value=" #{item.firstName} #{item.surname}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.age}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.age}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.pst}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.post}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.goa}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.goalkeeping}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.tec}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.technique}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.str}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.strength}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.spe}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.speed}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.sho}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.shot}"/>
                                </h:column>
                                <h:column rendered="#{manager.hasClub}">
                                    <h:commandButton action="#{manager.buy1stLinePlayer}" value="#{msgs.buy}" />
                                </h:column>
                            </h:dataTable>



                            <h3><h:outputText value="#{msgs.second_line}"/></h3>
                            <h:dataTable value="#{manager.secondLineModel}" var="item" rowClasses="OddRow,EvenRow" columnClasses="post,playerName,skill,skill,skill,skill,skill,skill,skill,switchPost">
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.pos}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.positionInCurrentTeam}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.player_name}"/>
                                    </f:facet>
                                    <h:graphicImage value="graphics/cze.png" width="20" height="14" alt="CZE" rendered="#{item.nationality == 'CZE'}"/>
                                    <h:graphicImage value="graphics/svk.gif" width="20" height="13" alt="SVK" rendered="#{item.nationality == 'SVK'}"/>
                                    <h:outputText value=" #{item.firstName} #{item.surname}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.age}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.age}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.pst}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.post}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.goa}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.goalkeeping}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.tec}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.technique}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.str}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.strength}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.spe}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.speed}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.sho}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.shot}"/>
                                </h:column>
                                <h:column rendered="#{manager.hasClub}">
                                    <h:commandButton action="#{manager.buy2ndLinePlayer}" value="#{msgs.buy}" />
                                </h:column>
                            </h:dataTable>



                            <h3><h:outputText value="#{msgs.third_line}"/></h3>
                            <h:dataTable value="#{manager.thirdLineModel}" var="item" rowClasses="OddRow,EvenRow" columnClasses="post,playerName,skill,skill,skill,skill,skill,skill,skill,switchPost">
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.pos}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.positionInCurrentTeam}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.player_name}"/>
                                    </f:facet>
                                    <h:graphicImage value="graphics/cze.png" width="20" height="14" alt="CZE" rendered="#{item.nationality == 'CZE'}"/>
                                    <h:graphicImage value="graphics/svk.gif" width="20" height="13" alt="SVK" rendered="#{item.nationality == 'SVK'}"/>
                                    <h:outputText value=" #{item.firstName} #{item.surname}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.age}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.age}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.pst}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.post}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.goa}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.goalkeeping}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.tec}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.technique}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.str}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.strength}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.spe}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.speed}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.sho}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.shot}"/>
                                </h:column>
                                <h:column rendered="#{manager.hasClub}">
                                    <h:commandButton action="#{manager.buy3rdLinePlayer}" value="#{msgs.buy}" />
                                </h:column>
                            </h:dataTable>



                            <h3><h:outputText value="#{msgs.fourth_line}" rendered="#{manager.hasFourthLine}"/></h3>
                            <h:dataTable value="#{manager.fourthLineModel}" var="item" rowClasses="OddRow,EvenRow" columnClasses="post,playerName,skill,skill,skill,skill,skill,skill,skill,switchPost" rendered="#{manager.hasFourthLine}">
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.pos}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.positionInCurrentTeam}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.player_name}"/>
                                    </f:facet>
                                    <h:graphicImage value="graphics/cze.png" width="20" height="14" alt="CZE" rendered="#{item.nationality == 'CZE'}"/>
                                    <h:graphicImage value="graphics/svk.gif" width="20" height="13" alt="SVK" rendered="#{item.nationality == 'SVK'}"/>
                                    <h:outputText value=" #{item.firstName} #{item.surname}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.age}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.age}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.pst}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.post}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.goa}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.goalkeeping}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.tec}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.technique}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.str}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.strength}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.spe}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.speed}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.sho}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.shot}"/>
                                </h:column>
                                <h:column rendered="#{manager.hasClub}">
                                    <h:commandButton action="#{manager.buy4thLinePlayer}" value="#{msgs.buy}" />
                                </h:column>
                            </h:dataTable>



                            <h3><h:outputText value="#{msgs.substitutes}"/></h3>
                            <h:dataTable value="#{manager.substitutesModel}" var="item" rowClasses="OddRow,EvenRow" columnClasses="post,playerName,skill,skill,skill,skill,skill,skill,skill,switchPost">
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.pos}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.positionInCurrentTeam}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.player_name}"/>
                                    </f:facet>
                                    <h:graphicImage value="graphics/cze.png" width="20" height="14" alt="CZE" rendered="#{item.nationality == 'CZE'}"/>
                                    <h:graphicImage value="graphics/svk.gif" width="20" height="13" alt="SVK" rendered="#{item.nationality == 'SVK'}"/>
                                    <h:outputText value=" #{item.firstName} #{item.surname}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.age}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.age}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.pst}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.post}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.goa}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.goalkeeping}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.tec}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.technique}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.str}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.strength}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.spe}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.speed}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="#{msgs.sho}"/>
                                    </f:facet>
                                    <h:outputText value="#{item.shot}"/>
                                </h:column>
                                <h:column rendered="#{manager.hasClub}">
                                    <h:commandButton action="#{manager.buySubstitute}" value="#{msgs.buy}" />
                                </h:column>
                            </h:dataTable>
                        </h:form>



                    </div>
                </div>

                <div class="clr" />














        </body>
    </html>
</f:view>
